//
//  LJBottomView.swift
//  LJWeibo
//
//  Created by Raymond on 15/12/22.
//  Copyright © 2015年 liu. All rights reserved.
//

import UIKit

class LJBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = UIColor(white: 0.95, alpha: 1)
        
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func prepareUI() {
        // 添加控件
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(zanButton)
        addSubview(firstSparatorView)
        addSubview(secondSparatorView)
        // 添加约束
        // 三个按钮水平平铺
        self.ff_HorizontalTile([forwardButton, commentButton, zanButton], insets: UIEdgeInsetsZero)
        firstSparatorView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        secondSparatorView.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
        
    }
    
    /// MARK: - 懒加载
    /// 转发按钮
    lazy var forwardButton: UIButton = UIButton(imageName: "timeline_icon_retweet", fontSize: 11, title: "转发")
    /// 评论按钮
    lazy var commentButton: UIButton = UIButton(imageName: "timeline_icon_comment", fontSize: 11, title: "评论")
    /// 点赞按钮
    lazy var zanButton: UIButton = UIButton(imageName: "timeline_icon_unlike", fontSize: 11, title: "赞")
    /// 第一条分割线
    lazy var firstSparatorView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    /// 第二条分割线
    lazy var secondSparatorView: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    

}
